package com.hna.eking.AirlineServer.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.hna.eking.AirlineServer.Exception.RunServiceException;
import com.hna.eking.AirlineServer.Mapper.CodeInfo;
import com.hna.eking.AirlineServer.Mapper.CodeInfoMapper;


/**
*
* 代码表控制类 
* Date : 2018-9-18
* Description: 
* 代码表控制类 
* Copyright: Copyright &copy;
* 2018 Company :aivac
* 
* @author APP BD lele
* @version V1.0 修改历史 序号 日期 修改人 修改原因 1
* 
*/
@Service
public class CodeInfoService {
	@Autowired
	private CodeInfoMapper mapper;
	
	private Logger logger = LoggerFactory.getLogger(AirportInfoService.class);
	/*
	 * 查询所有编码
	 * 
	 * 参数： 
	 * 	codeType：代码类型
	 * 
	 * 返回： 
	 * 	地区列表
	 *
	 */
	public List<CodeInfo>  selectByCodeType(String codeType) {
		List<CodeInfo> list = null;
		try {
			list = mapper.selectByCodeType(codeType);
		} catch (DataAccessException e) {
			logger.error("DATABASE ERROR");
			e.printStackTrace();
			throw new RunServiceException(RunServiceException.DATABASE_ERROR);
		}
		return list;
	}
}
